package com.opdar.athena.web.base;

import com.opdar.athena.base.IServerInfo;
import com.opdar.athena.registry.ZookeeperRegistry;
import org.springframework.beans.factory.annotation.Autowired;

import java.net.InetSocketAddress;
import java.util.List;

/**
 * Created by shiju on 2017/8/16.
 */
public class AthenaServerInfo implements IServerInfo {

    @Autowired
    ZookeeperRegistry zookeeperRegistry;

    @Override
    public List<InetSocketAddress> getAddress() {
        zookeeperRegistry.read();
        return zookeeperRegistry.getAddresses();
    }
}
